const {merge} = require('webpack-merge');
const common = require('./webpack.common')
const webpack = require('webpack')
var OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin');
var TerserWebpackPlugin = require('terser-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
module.exports = merge(common,{
    mode:'production',
    output:{
        filename:'[name]-[contenthash].bundle.js'
    },
    module:{
       
    },
    plugins:[
        new webpack.DefinePlugin({
            BASE_URL:JSON.stringify('http://production.com/')
        }),
        new OptimizeCssAssetsPlugin(),
    ],
    optimization:{
        minimizer:[
            new OptimizeCssAssetsPlugin(),
            // new TerserWebpackPlugin(),
            new MiniCssExtractPlugin({
                filename:'[name]-[contenthash]-bundle.css'
            }),
        ]
    }
})